#pragma once
#include "AllocTracker.h"
#include <malloc.h>


namespace GBase
{
	class StdAllocPolicy
	{
	public:
		static inline void* allocateBytes(size_t count, const char* file = 0, int line = 0, const char* funname = 0)
		{
			void* ptr = malloc(count);
#ifdef ALLOC_TRACK
			AllocTracker::Get().AllocReport(ptr, count, file, line, funname);
#endif
			return ptr;
		}

		static inline void deallocateBytes(void* ptr)
		{
#ifdef ALLOC_TRACK
			AllocTracker::Get().DeallocReport(ptr);
#endif
			free(ptr);
		}
	};
}
